home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks96 / InternetChooser.sit / Internet Chooser / Sample LDEFs 2.0 / (Sys 7) Icon LDEF / Tester Src / List.c < prev    next >
Text File  |  1993-10-22  |  1KB  |  53 lines

  1. // File "List.c"
  2.  
  3. #include <Icons.h>
  4. #include "main.h"
  5. #include "List.h"
  6.  
  7. extern WindowPtr gWindow;
  8. extern ListHandle gList;
  9.  
  10. // * **************************************************************************** * //
  11. // * **************************************************************************** * //
  12.  
  13. void CreateList() {
  14.     Cell theCell;
  15.     Rect destRect, cellRect;
  16.     GrafPtr savePort;
  17.     Handle iconHdl;
  18.     Str63 textBuff;
  19.     
  20.     GetPort(&savePort);
  21.     SetPort(gWindow);
  22.     
  23.     destRect = gWindow->portRect;
  24.     destRect.right -= 15;
  25.     destRect.bottom -= 15;
  26.     
  27.     SetRect(&cellRect, 0, 0, 1, 0);
  28.     theCell.h = 120; theCell.v = 54;
  29.     
  30.     TextFont(1); TextSize(9); TextFace(bold);
  31.     gList = LNew(&destRect, &cellRect, theCell, 130, gWindow, 0, -1, -1, -1);
  32.     
  33.     LAddRow(6, 0, gList);
  34.     for(theCell.h = theCell.v = 0; theCell.v < (*gList)->dataBounds.bottom; theCell.v++) {
  35.         GetIconSuite(&iconHdl, 1001 + theCell.v, svAllAvailableData);
  36.         LSetCell(&iconHdl, 4, theCell, gList);
  37.         LAddToCell("Cell ", sizeof("Cell "), theCell, gList);
  38.         NumToString(theCell.v, textBuff);
  39.         LAddToCell(textBuff+1, textBuff[0], theCell, gList);
  40.         }
  41.     LDoDraw(-1, gList);
  42.     
  43.     SetPort(savePort);
  44.     }
  45.  
  46. // * **************************************************************************** * //
  47. // * **************************************************************************** * //
  48.  
  49. void DisposeList() {
  50.  
  51.     LDispose(gList);
  52.     }
  53.